<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>调用call，请求apply和绑定bind</title>
</head>
<body>
<script>
    //call
    // const bruce = {
    //     name:"Bruce",
    // };
    // const madeline = {
    //     name:"Madeline",
    // };
    // function greet() {
    //     return `hello,i am ${this.name}`;
    // }
    // console.log(greet());
    // console.log(greet.call(bruce));
    // console.log(greet.call(madeline));

    const bruce = {
        name:"Bruce",
    };
    const madeline = {
        name:"Madeline",
    };
    function update(birth,occupation) {
        this.birth = birth;
        this.occupation = occupation;
    }
    update.call(bruce,1949,'singer');

    console.log(`brunce:{name:{brunce.name}`)
</script>
</body>
</html>